<?php session_start();?>
<?php
// used to start inialize the session
// this will delete the variable of the session which is the user name
setcookie("cookemail", "", time() - 60 * 60 * 24 * 100, "/");
setcookie("cookpass", "", time() - 60 * 60 * 24 * 100, "/");
session_unset();
session_destroy();
// delete session
header("Location: index.php");
// return to the login page again
?>
<script type="text/javascript">
    function timeoutMsg() //TimeOut Function
    {
        setTimeout("alertMsg()",19800000); //Set an alret message that will appear to the user after 5hrs and half
    }
    function alertMsg() //alret message function that will appear
    {
        alert('Warning: You will be Logged out after 30 mins'); //an alret message that the system will logged out after 30 mins
        setTimeout("disableMsg()",1800000);  // Set timeout message after 30 mins to display the use of the page
    }
    function disableMsg() //function that will disable the use of system
    {
        alert('Please SignIn again'); // message appear to the user asks him to SignIn again
         }

</script>
